package com.learndemo.mvcpvmdemo.mvp;

import com.learndemo.mvcpvmdemo.bean.Account;
import com.learndemo.mvcpvmdemo.callback.MCallback;

public class MVPPresenter {
    private IMVPView mView;
    private MVPModel mModel;

   public MVPPresenter(IMVPView mView){
       this.mView = mView;
       mModel = new MVPModel();
   }

    public void getData(String accountName) {
       mModel.getAccountData(accountName, new MCallback() {
           @Override
           public void onSuccess(Account account) {
                mView.showSuccessPage(account);
           }

           @Override
           public void onFailed() {
               mView.showFailedPage();
           }
       });
    }
}
